//
//  NSDictionary+ToString.m
//  test
//
//  Created by mc on 2017/5/12.
//  Copyright © 2017年 BJGD. All rights reserved.
//

#import "NSDictionary+ToString.h"

@implementation NSDictionary (ToString)


//字典转json格式字符串：
+ (NSString*)dictionaryToJson:(NSDictionary *)dic
{
    NSError *parseError = nil;
    NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dic options:NSJSONWritingPrettyPrinted error:&parseError];
    
    return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
}
@end
